Skip to content

Optimise rendering of Pageviewer pages for HiDPI screens #608

Open
hoyla wants to merge 1 commit intomainfrom
ljh-pageviewer-ux-2
Open

Optimise rendering of Pageviewer pages for HiDPI screens #608
hoyla wants to merge 1 commit intomainfrom
ljh-pageviewer-ux-2

Conversation

@hoyla
Copy link
Contributor

@hoyla hoyla commented Mar 13, 2026

Fixes #609

All screens are 'Retina'/HiDPI these days, so optimising for 72px/inch is no longer appropriate.

This multiplies the canvas backing store dimensions by window.devicePixelRatio and sets explicit CSS width/height to maintain the same footprint. Applies canvasContext.scale(dpr, dpr) so PDF.js renders at the higher resolution.

The logical scale returned in CachedPreview is unchanged, so text overlays (for selection and copy-paste), search highlights, find-in-document highlights, and comment selection geometry are all unaffected.

Before:
Picture 58

After:
Picture 57

Tested:

  • Local dev
  • Playground

Multiply the canvas backing store dimensions by window.devicePixelRatio
and set explicit CSS width/height to maintain the same logical layout
footprint. Apply canvasContext.scale(dpr, dpr) so PDF.js renders at the
higher resolution.

The logical scale returned in CachedPreview is unchanged, so text
overlays (for selection/copy-paste), search highlights, find-in-document
highlights, and comment selection geometry are all unaffected.
@hoyla hoyla added document viewer ux/ui fix Departmental tracking: fix labels Mar 13, 2026
@hoyla hoyla self-assigned this Mar 14, 2026
@hoyla hoyla linked an issue Mar 14, 2026 that may be closed by this pull request
@hoyla hoyla marked this pull request as ready for review March 14, 2026 20:18
@hoyla hoyla requested a review from a team as a code owner March 14, 2026 20:18
@hoyla hoyla removed their assignment Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

document viewer fix Departmental tracking: fix ux/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PageViewer: make text less soft

1 participant